func fourSumCount(nums1 []int, nums2 []int, nums3 []int, nums4 []int) int {
    ans := 0
    hashMap := make(map[int]int)
    n := len(nums1)
    for i:=0; i<n; i++ {
        for j:=0; j<n; j++ {
            sum := nums1[i] + nums2[j]
            if _, ok := hashMap[sum]; ok {
                hashMap[sum]++
            } else {
                hashMap[sum] = 1
            }
        }
    }

    for i:=0; i<n; i++ {
        for j:=0; j<n; j++ { 
            need := 0 - (nums3[i] + nums4[j])
            if _, ok := hashMap[need]; ok {
                ans += hashMap[need]
            }
        }
    }
    return ans
}